*****************************************************************************************
**********************Replication Code for Tables 1, 3, A3-A18***************************
***of "Ethnicity and Strategic Repression of Protest during the 2011 Syrian Uprising"****
*****by Konstantin Ash and Kevin Mazur, forthcoming in Perspectives on Politics**********
*****************************************************************************************


***Upload STATA .dta file**********************************
***Change directory to location of replication folder******
****Code compatible with STATA 10 and above unless noted***

#delimit;
clear;
cd "~/kakm_pop_replication";
use l4repression_main;

***Table 1: Statistics***
#delimit;
tab emaj5cat;
total tot_pop if emaj5cat=="alawi";
total tot_pop if emaj5cat=="kurdish";
total tot_pop if emaj5cat=="badawi";
total tot_pop if emaj5cat=="sunnifam";
total tot_pop if emaj5cat=="othermin";

***Descriptive Statistics of Repression Distribution noted in text***
tab number_killed_5k_oct11;


****Table 3: Heckman Selection Models***
#delimit;
xi: heckman number_killed_oct11_bin kurdbin badawibin alawibin othermin  i.adm1_pcode, select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo a1;
xi: heckman number_killed_oct11_bin1k kurdbin badawibin alawibin othermin  i.adm1_pcode, select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo a2;

encode adm2_en, gen(adm2_code);

***Reducing large counts to facilitate convergence of Heckman Poisson***;
#delimit;
gen number_killed_5k_oct11_reduced=number_killed_5k_oct11;
replace number_killed_5k_oct11_reduced=150 if number_killed_5k_oct11_reduced>150 & number_killed_5k_oct11_reduced!=.;
gen number_killed_oct11_1k_reduced=number_killed_oct11_1k;
replace number_killed_oct11_1k_reduced=150 if number_killed_oct11_1k_reduced>150 & number_killed_oct11_1k_reduced!=.;

xi:  heckpoisson number_killed_5k_oct11_reduced kurdbin badawibin alawibin othermin  , select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange5k avgtempchange5k) vce(cluster adm2_code) difficult irr;
eststo g1;
xi: heckpoisson number_killed_oct11_1k_reduced kurdbin badawibin alawibin othermin, select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange5k avgtempchange5k) vce(cluster adm2_code) difficult irr;
eststo g2;
estout a1 a2 g1 g2 using heckman_full.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);



****APPENDIX****

***Appendix 2***

***Table A3: Naive Logit Models***
****5k buffers***
#delimit;
xi: logit  numkilled5k_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 cncs_bin  i.adm1_pcode, vce(cluster adm2_en);
eststo c1;
xi: logit  number_killed_jan12_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 cncs_bin  i.adm1_pcode,  vce(cluster adm2_en);
eststo c2;
xi: logit  number_killed_oct11_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 cncs_bin  i.adm1_pcode, vce(cluster adm2_en);
eststo c3;
***1k buffers***;
xi: logit  dum_fat_total_1 logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907  cncs_bin i.adm1_pcode,  vce(cluster adm2_en);
eststo c4;
xi: logit  number_killed_jan12_bin1k logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 cncs_bin  i.adm1_pcode, vce(cluster adm2_en);
eststo c5;
xi: logit  number_killed_oct11_bin1k logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 cncs_bin  i.adm1_pcode,  vce(cluster adm2_en);
eststo c6;
estout c3 c2 c1 c6 c5 c4 using logit_repression.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);

***Appendix 2.1***

***Table A4: Protest*Sect Interaction***

#delimit;
gen cncs_bin_kurd = cncs_bin*kurdbin;
gen cncs_bin_badawi = cncs_bin*badawibin;
gen cncs_bin_alawi = cncs_bin*alawibin;
gen cncs_bin_other = cncs_bin*othermin;
#delimit;
xi: logit  numkilled5k_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin cncs_bin_kurd cncs_bin_badawi cncs_bin_alawi cncs_bin_other  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 cncs_bin  i.adm1_pcode, vce(cluster adm2_en);
eststo int1;
xi: logit  number_killed_jan12_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin cncs_bin_kurd cncs_bin_badawi cncs_bin_alawi cncs_bin_other  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 cncs_bin  i.adm1_pcode,  vce(cluster adm2_en);
eststo int2;
xi: logit  number_killed_oct11_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin cncs_bin_kurd cncs_bin_badawi cncs_bin_alawi cncs_bin_other  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 cncs_bin  i.adm1_pcode, vce(cluster adm2_en);
eststo int3;
***1k buffers***;
xi: logit  dum_fat_total_1 logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin cncs_bin_kurd cncs_bin_badawi cncs_bin_alawi cncs_bin_other  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907  cncs_bin,  vce(cluster adm2_en);
eststo int4;
xi: logit  number_killed_jan12_bin1k logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin cncs_bin_kurd cncs_bin_badawi cncs_bin_alawi cncs_bin_other  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 cncs_bin, vce(cluster adm2_en);
eststo int5;
xi: logit  number_killed_oct11_bin1k logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin cncs_bin_kurd cncs_bin_badawi cncs_bin_alawi cncs_bin_other  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 cncs_bin  i.adm1_pcode,  vce(cluster adm2_en);
eststo int6;
estout int3 int2 int1 int6 int5 int4 using interaction_cncs.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);

***Appendix 3***

***Tables A5/A6: Heckman and Heckman Poisson with Different Instrument Specifications***
****Table A5: Basic Heckman Model***
#delimit;
xi: heckman number_killed_oct11_bin kurdbin badawibin alawibin othermin  i.adm1_pcode, select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange10k avgtempchange10k) vce(cluster adm2_en);
eststo a3;
xi: heckman number_killed_oct11_bin1k kurdbin badawibin alawibin othermin  i.adm1_pcode, select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange10k avgtempchange10k) vce(cluster adm2_en);
eststo a4;
xi: heckman number_killed_oct11_bin kurdbin badawibin alawibin othermin  i.adm1_pcode, select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange5k avgtempchange5k temp_prcp5k ) vce(cluster adm2_en);
eststo a5;
xi: heckman number_killed_oct11_bin1k kurdbin badawibin alawibin othermin  i.adm1_pcode, select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange5k avgtempchange5k temp_prcp5k ) vce(cluster adm2_en);
eststo a6;
xi: heckman number_killed_oct11_bin kurdbin badawibin alawibin othermin  i.adm1_pcode, select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange10k avgtempchange10k temp_prcp10k ) vce(cluster adm2_en);
eststo a7;
xi: heckman number_killed_oct11_bin1k kurdbin badawibin alawibin othermin  i.adm1_pcode, select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange10k avgtempchange10k temp_prcp10k ) vce(cluster adm2_en);
eststo a8;
estout a3 a4 a5 a6 a7 a8 using basic_heckman2.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);


****Heckman Poisson in STATA 16+****

***Table A6: Heckman Poisson Selection Model***
#delimit;
xi: heckpoisson number_killed_5k_oct11_reduced kurdbin badawibin alawibin othermin  , select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange10k avgtempchange10k) vce(cluster adm2_code) difficult irr;
eststo g3;
xi: heckpoisson number_killed_oct11_1k_reduced kurdbin badawibin alawibin othermin, select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange10k avgtempchange10k) vce(cluster adm2_code) difficult irr;
eststo g4;
xi: heckpoisson number_killed_5k_oct11_reduced kurdbin badawibin alawibin othermin  , select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange5k avgtempchange5k temp_prcp5k ) vce(cluster adm2_code) difficult irr;
eststo g5;
xi: heckpoisson number_killed_oct11_1k_reduced kurdbin badawibin alawibin othermin  , select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange5k avgtempchange5k temp_prcp5k ) vce(cluster adm2_code) difficult irr;
eststo g6;
xi: heckpoisson number_killed_5k_oct11_reduced kurdbin badawibin alawibin othermin  , select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange10k avgtempchange10k temp_prcp10k ) vce(cluster adm2_code) difficult irr;
eststo g7;
xi: heckpoisson number_killed_oct11_1k_reduced kurdbin badawibin alawibin othermin, select(cncs_bin =kurdbin badawibin alawibin othermin  avgprcpchange10k avgtempchange10k temp_prcp10k ) vce(cluster adm2_code) difficult irr;
eststo g8;
estout g3 g4 g5 g6 g7 g8 using heckman_poisson2.tex, replace eform cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);

***Appendix 4***

***Tables A7/A8 Full Controls Different Instrument Combos with F-Tests***

#delimit;
xi: heckman number_killed_oct11_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo b1;
test avgprcpchange5k avgtempchange5k;
xi: heckman number_killed_oct11_bin1k logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
test avgprcpchange5k avgtempchange5k;
eststo b2;
xi: heckman number_killed_oct11_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k temp_prcp5k) vce(cluster adm2_en);
test avgprcpchange5k avgtempchange5k  temp_prcp5k;
eststo b3;
xi: heckman number_killed_oct11_bin1k logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k temp_prcp5k) vce(cluster adm2_en);
test avgprcpchange5k avgtempchange5k  temp_prcp5k;
eststo b4;
xi: heckman number_killed_oct11_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange10k avgtempchange10k ) vce(cluster adm2_en);
test avgprcpchange10k avgtempchange10k;
eststo b5;
xi: heckman number_killed_oct11_bin1k logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange10k avgtempchange10k  ) vce(cluster adm2_en);
test avgprcpchange10k avgtempchange10k;
eststo b6;
xi: heckman number_killed_oct11_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange10k avgtempchange10k  temp_prcp10k ) vce(cluster adm2_en);
test avgprcpchange10k avgtempchange10k  temp_prcp10k;
eststo b7;
xi: heckman number_killed_oct11_bin1k logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist avgprcpchange10k avgtempchange10k  temp_prcp10k ) vce(cluster adm2_en);
test avgprcpchange10k avgtempchange10k  temp_prcp10k;
eststo b8;
estout b1 b2 b3 b4 b5 b6 b7 b8 using fullcontrols_oct2011.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);




***Tables A9/A10 Varying repression end times*****
****5k buffers***
#delimit;
xi: heckman numkilled5k_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo c1;
xi: heckman number_killed_jan12_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo c2;
xi: heckman number_killed_oct11_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo c3;
***1k buffers***;
xi: heckman  dum_fat_total_1 logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo c4;
xi: heckman number_killed_jan12_bin1k logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo c5;
xi: heckman number_killed_oct11_bin1k logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo c6;
estout c3 c2 c1 c6 c5 c4 using hecktwostepmain.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);


***Appendix 5.1***

****Table A11: Association between drought and protest without controls***
#delimit;
xi: logit  cncs_bin  avgprcpchange5k avgtempchange5k  , vce(cluster adm2_en);
eststo d1;
xi: logit  cncs_bin  avgprcpchange10k avgtempchange10k  , vce(cluster adm2_en);
eststo d2;
xi: logit  cncs_bin  avgprcpchange5k avgtempchange5k  temp_prcp5k  ,vce(cluster adm2_en);
eststo d3;
xi: logit  cncs_bin  avgprcpchange10k avgtempchange10k  temp_prcp10k  , vce(cluster adm2_en);
eststo d4;
estout d1 d2 d3 d4 using relevancetest.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);

***Appendix 5.2***

****Table A12: Validating Instrument****
#delimit;
drop error4;
glm numkilled5k_bin logpop secplus pgelec govwrkr kurdbin badawibin alawibin rd_dens l3_milsec l3_rugg border_dist nld0907 cncs_bin, family(binomial) link(logit) eform vce(cluster l3_pcode);
predict error4, p;
corr avgprcpchange5k avgtempchange5k error4;
reg error4  logpop secplus pgelec govwrkr kurdbin badawibin alawibin rd_dens l3_milsec l3_rugg border_dist nld0907 cncs_bin avgprcpchange5k avgtempchange5k , vce(cluster l3_pcode);
eststo e1;
corr avgprcpchange10k avgtempchange10k error4;
reg error4  logpop secplus pgelec govwrkr kurdbin badawibin alawibin rd_dens l3_milsec l3_rugg border_dist nld0907 cncs_bin avgprcpchange10k avgtempchange10k , vce(cluster l3_pcode);
eststo e2;
corr avgprcpchange5k avgtempchange5k temp_prcp5k  error4;
reg error4  logpop secplus pgelec govwrkr kurdbin badawibin alawibin rd_dens l3_milsec l3_rugg border_dist nld0907 cncs_bin avgprcpchange5k avgtempchange5k temp_prcp5k , vce(cluster l3_pcode);
eststo e3;
corr avgprcpchange10k avgtempchange10k temp_prcp10k  error4;
reg error4  logpop secplus pgelec govwrkr kurdbin badawibin alawibin rd_dens l3_milsec l3_rugg border_dist nld0907 cncs_bin avgprcpchange10k avgtempchange10k temp_prcp10k , vce(cluster l3_pcode);
eststo e4;
estout e1 e2 e3 e4 using validitytest.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);

***Appendix 5.3***


****Weather Station Coding and Predictions***
#delimit;
gen weather_station_1998_5k=0;
gen weather_station_2010_5k=0;
replace weather_station_1998_5k=1 if name_en=="Tadmor";
replace weather_station_2010_5k=1 if name_en=="Tadmor";
replace weather_station_1998_5k=1 if name_en=="Abu Kamal" | name_en=="Hura" | name_en=="Sweiyeh" | name_en=="Upper Baguz";
replace weather_station_1998_5k=1 if name_en=="Deir-Ez-Zor" | name_en=="Hwaijet Qate'" | name_en=="Hwaijet Saker";
replace weather_station_2010_5k=1 if name_en=="Deir-Ez-Zor" | name_en=="Hwaijet Qate'" | name_en=="Hwaijet Saker";
replace weather_station_1998_5k=1 if name_en=="Al-Hasakeh" | name_en=="Qaber Amer" | name_en=="Southern Lower Um Hajra" | name_en=="Talaah";
replace weather_station_1998_5k=1 if name_en=="Big Dankhiyeh" | name_en=="Quamishli" | name_en=="Tal Fares" | name_en=="Tartab";
replace weather_station_2010_5k=1 if name_en=="Big Dankhiyeh" | name_en=="Quamishli" | name_en=="Tal Fares" | name_en=="Tartab";
replace weather_station_1998_5k=1 if name_en=="Samuqet Aazaz" | name_en=="Alsayed Ali" | name_en=="Em Al-Qura" | name_en=="Harbal" | name_en=="Hissiyeh" | name_en=="Hosniyeh - Hsajek" | name_en=="Maratet Um Hosh" | name_en=="Saed - Qlsroj" | name_en=="Tal Maled" | name_en=="Telqraq" | name_en=="Wahshiyeh" | name_en=="Kafr Elward";
replace weather_station_2010_5k=1 if name_en=="Samuqet Aazaz" | name_en=="Alsayed Ali" | name_en=="Em Al-Qura" | name_en=="Harbal" | name_en=="Hissiyeh" | name_en=="Hosniyeh - Hsajek" | name_en=="Maratet Um Hosh" | name_en=="Saed - Qlsroj" | name_en=="Tal Maled" | name_en=="Telqraq" | name_en=="Wahshiyeh" | name_en=="Kafr Elward";
replace weather_station_1998_5k=1 if name_en=="Falyun" | name_en=="Idleb" | name_en=="Mastumeh" | name_en=="Qminas";
replace weather_station_1998_5k=1 if name_en=="Lattakia";
replace weather_station_2010_5k=1 if name_en=="Lattakia";
replace weather_station_1998_5k=1 if name_en=="Ennabiya" | name_en=="Tartous" | name_en=="Arwad";
replace weather_station_1998_5k=1 if name_en=="Dahr Bashir"  | name_en=="Beit Elsheikh Yunis" | name_en=="Beit Naaseh" | name_en=="Dahr Elyazdiyeh" | name_en=="Damaqs - Bimsaqs"  | name_en=="Joret Elshanbur" | name_en=="Kherbet Abu Hamdan" | name_en=="Kniset Safita" | name_en=="Maab - Obin" | name_en=="Mweiseh"| name_en=="Naameh - Kafrikha" | name_en=="Naasat" | name_en=="Safita" | name_en=="Um Hosh" | name_en=="Yazidiyet Hamdan" | name_en=="Zabraqan" | name_en=="Zawraq Barakat" | name_en=="Bait Ahmed Wanus" | name_en=="Dora - Baddada" | name_en=="Ein Dabesh" | name_en=="Hikr Jeb Elamlas" | name_en=="Jeb Elamlas" | name_en=="Kherbet Eljeb" | name_en=="Madafa - Kafr Deif" | name_en=="Meisrat" | name_en=="Sisniyyeh" | name_en=="Ras El-Khashufeh" | name_en=="Ras Mandu" ;
replace weather_station_1998_5k=1 if name_en=="Baamra" & adm2_en=="Safita";
replace weather_station_1998_5k=1 if name_en=="Hanjur" & & adm2_en=="Safita";
replace weather_station_1998_5k=1 if name_en=="Dar Kabira" | name_en=="Fayruza" | name_en=="Homs" | name_en=="Kafr Aaya"| name_en=="Mazraa - Wa'er" | name_en=="Muhajerine" | name_en=="Zaydal";
replace weather_station_1998_5k=1 if name_en=="Ayo" | name_en=="Hama" | name_en=="Jajiyeh" | name_en=="Kafr Bihem" | name_en=="Maqtaa Elhajar" | name_en=="Sreihin";
replace weather_station_1998_5k=1 if name_en=="Kalidiyeh" & adm2_en=="Hama";
replace weather_station_1998_5k=1 if name_en=="Maarin" & adm2_en=="Hama";
replace weather_station_2010_5k=1 if name_en=="Ayo" | name_en=="Hama" | name_en=="Jajiyeh" | name_en=="Kafr Bihem" | name_en=="Maqtaa Elhajar" | name_en=="Sreihin";
replace weather_station_2010_5k=1 if name_en=="Kalidiyeh" & adm2_en=="Hama";
replace weather_station_2010_5k=1 if name_en=="Maarin" & adm2_en=="Hama";
replace weather_station_1998_5k=1 if name_en=="Ghassuleh" | name_en=="Ghizlaniyyeh" | name_en=="Hayajneh"| name_en=="Saka" | name_en=="Tal Maskan" | name_en=="Jdidet Elkhas";
replace weather_station_1998_5k=1 if name_en=="Bayad" & adm2_en=="Duma";
replace weather_station_2010_5k=1 if name_en=="Ghassuleh" | name_en=="Ghizlaniyyeh" | name_en=="Hayajneh"| name_en=="Saka" | name_en=="Tal Maskan" | name_en=="Jdidet Elkhas";
replace weather_station_2010_5k=1 if name_en=="Bayad" & adm2_en=="Duma";

****Table A13: Predicting Weather Station Location****
#delimit
xi: logit weather_station_1998_5k logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist,vce(cluster adm2_en);
eststo w1;
xi: logit weather_station_2010_5k logpop secplus pgelec govwrkr kurdbin badawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist,vce(cluster adm2_en);
eststo w3;
estout w1 w3 using weather_stations.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);

***Appendix 6***
  
***Tables A14/A15: Shuhada Data Selection Models***
****5k buffers***
#delimit;
xi: heckman shuhada5k_july12  logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo g1;
xi: heckman shuhada5k_jan12 logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo g2;
xi: heckman shuhada5k_oct11 logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo g3;
***1k buffers***;
xi: heckman  shuhada1k_july12 logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo g4;
xi: heckman shuhada1k_jan12 logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo g5;
xi: heckman shuhada1k_oct11 logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907 i.adm1_pcode, select(cncs_bin =logpop secplus pgelec govwrkr kurdbin badawibin alawibin othermin  rd_dens l3_milsec l3_rugg  nld0907 distkm_nearestl1 border_dist  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo g6;
estout g3 g2 g1 g6 g5 g4 using heckman_shuhada.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);





***Appendix 9***

****Table A16: Population Interaction***
#delimit;
gen logpop_kurd=logpop*kurdbin;
gen logpop_badawi=logpop*badawibin ;
gen logpop_alawi=logpop*alawibin ;
gen logpop_othermin=logpop*othermin ;

#delimit;
xi: heckman number_killed_oct11_bin kurdbin badawibin alawibin othermin logpop logpop_kurd logpop_badawi logpop_alawi logpop_othermin  i.adm1_pcode, select(cncs_bin =kurdbin badawibin alawibin othermin logpop logpop_kurd logpop_badawi logpop_alawi logpop_othermin  avgprcpchange5k avgtempchange5k ) vce(cluster adm2_en);
eststo f1;
test avgprcpchange5k avgtempchange5k ;
xi: heckman number_killed_oct11_bin1k kurdbin badawibin alawibin othermin logpop logpop_kurd logpop_badawi logpop_alawi logpop_othermin  i.adm1_pcode, select(cncs_bin =kurdbin badawibin alawibin othermin logpop logpop_kurd logpop_badawi logpop_alawi logpop_othermin  avgprcpchange5k avgtempchange5k ) vce(cluster adm2_en);
eststo f2;
test avgprcpchange5k avgtempchange5k ;
xi: heckman number_killed_oct11_bin kurdbin badawibin alawibin othermin logpop logpop_kurd logpop_badawi logpop_alawi logpop_othermin secplus pgelec govwrkr rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907  i.adm1_pcode, select(cncs_bin =kurdbin badawibin alawibin othermin logpop logpop_kurd logpop_badawi logpop_alawi logpop_othermin secplus pgelec govwrkr rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907   avgprcpchange5k avgtempchange5k ) vce(cluster adm2_en);
eststo f3;
test avgprcpchange5k avgtempchange5k ;
xi: heckman number_killed_oct11_bin1k kurdbin badawibin alawibin othermin logpop logpop_kurd logpop_badawi logpop_alawi logpop_othermin secplus pgelec govwrkr rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907   i.adm1_pcode, select(cncs_bin =kurdbin badawibin alawibin othermin logpop logpop_kurd logpop_badawi logpop_alawi logpop_othermin secplus pgelec govwrkr rd_dens l3_milsec l3_rugg border_dist  distkm_nearestl1 nld0907   avgprcpchange5k avgtempchange5k ) vce(cluster adm2_en);
eststo f4;
test avgprcpchange5k avgtempchange5k ;
estout f1 f3 f2 f4 using popinteraction.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);

***Appendix 10***

****Table A17 Statistics***

#delimit;
insheet using "ethnicity_db.csv", comma;
rename v1 l4_pcode;
rename v2 l3_pcode;
rename v3 l1_ar;
rename v4 l3_ar;
rename v5 l4_ar;
rename v6 ethn1;
rename v7 pct1;
rename v8 ethn2;
rename v9 pct2;
rename v10 ethn3;
rename v11 pct3;
rename v12 ethn4;
rename v13 pct4;
rename v14 ethn5;
rename v15 pct5;
rename v16 ethn6;
rename v17 pct6;
drop in 1;
#delimit;
replace ethn1="Other" if ethn1!="Sunni" &ethn1!="Sunni Tribes" &ethn1!="Alawi" &ethn1!="Kurds" &ethn1!="" ;
replace ethn2="Other" if ethn2!="Sunni" &ethn2!="Sunni Tribes" &ethn2!="Alawi" &ethn2!="Kurds" &ethn2!="";
replace ethn3="Other" if ethn3!="Sunni" &ethn3!="Sunni Tribes" &ethn3!="Alawi" &ethn3!="Kurds" &ethn3!="";
replace ethn4="Other" if ethn4!="Sunni" &ethn4!="Sunni Tribes" &ethn4!="Alawi" &ethn4!="Kurds" &ethn4!="";
replace ethn5="Other" if ethn5!="Sunni" &ethn5!="Sunni Tribes" &ethn5!="Alawi" &ethn5!="Kurds" &ethn5!="";
replace ethn6="Other" if ethn6!="Sunni" &ethn6!="Sunni Tribes" &ethn6!="Alawi" &ethn6!="Kurds" &ethn6!="";
keep l4_pcode l3_pcode ethn1 pct1 ethn2 pct2 ethn3 pct3 ethn4 pct4 ethn5 pct5 ethn6 pct6;
sort l4_pcode l3_pcode;
save ethnicity__db,replace;
use l4repression_main;
sort  l4_pcode l3_pcode;
merge l4_pcode l3_pcode using ethnicity__db;

tab ethn1 pct1, ro;
tab ethn2 pct2 if ethn1=="Kurds" & pct1=="33-50%";
tab ethn2 pct2 if ethn1=="Kurds" & pct1=="11-32%";
tab ethn2 pct2 if ethn1=="Sunni Tribes" & pct1=="33-50%"
tab ethn2 pct2 if ethn1=="Kurds" & pct1=="51-80%";
tab ethn2 pct2 if ethn1=="Sunni Tribes" & pct1=="51-80%"
tab ethn3 pct3 if ethn1=="Sunni Tribes" & pct1=="51-80%"


gen kurd_badawi=.;
replace kurd_badawi=0 if ethn1!="";
replace kurd_badawi=1 if ethn1=="Kurds" & pct1=="33-50%" & ethn2=="Sunni Tribes";
replace kurd_badawi=1 if ethn1=="Kurds" & pct1=="51-80%" & ethn2=="Sunni Tribes";
replace kurd_badawi=1 if ethn1=="Kurds" & pct1=="11-32%";
replace kurd_badawi=1 if ethn1=="Sunni Tribes" & pct1=="33-50%" & ethn2=="Kurds";
replace kurd_badawi=1 if ethn1=="Sunni Tribes" & pct1=="51-80%" & ethn2=="Kurds";
tab kurd_badawi;
#delimit;
gen kurd_all=kurdbin;
replace kurd_all=0 if kurd_badawi==1;
gen badawi_all=badawibin;
replace badawi_all=0 if kurd_badawi==1;

****Table A18: Basic Heckman Model with Overlap***
#delimit;
xi: heckman number_killed_oct11_bin kurd_all badawi_all kurd_badawi alawibin othermin  i.adm1_pcode, select(cncs_bin =kurd_all badawi_all kurd_badawi alawibin othermin  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo o1;
xi: heckman number_killed_oct11_bin1k kurd_all badawi_all kurd_badawi alawibin othermin  i.adm1_pcode, select(cncs_bin =kurd_all badawi_all kurd_badawi alawibin othermin  avgprcpchange5k avgtempchange5k) vce(cluster adm2_en);
eststo o2;
xi: heckman number_killed_oct11_bin kurd_all badawi_all kurd_badawi alawibin othermin  i.adm1_pcode, select(cncs_bin =kurd_all badawi_all kurd_badawi alawibin othermin  avgprcpchange10k avgtempchange10k) vce(cluster adm2_en);
eststo o3;
xi: heckman number_killed_oct11_bin1k kurd_all badawi_all kurd_badawi alawibin othermin  i.adm1_pcode, select(cncs_bin =kurd_all badawi_all kurd_badawi alawibin othermin  avgprcpchange10k avgtempchange10k) vce(cluster adm2_en);
eststo o4;
xi: heckman number_killed_oct11_bin kurd_all badawi_all kurd_badawi alawibin othermin  i.adm1_pcode, select(cncs_bin =kurd_all badawi_all kurd_badawi alawibin othermin  avgprcpchange5k avgtempchange5k temp_prcp5k ) vce(cluster adm2_en);
eststo o5;
xi: heckman number_killed_oct11_bin1k kurd_all badawi_all kurd_badawi alawibin othermin  i.adm1_pcode, select(cncs_bin =kurd_all badawi_all kurd_badawi alawibin othermin  avgprcpchange5k avgtempchange5k temp_prcp5k ) vce(cluster adm2_en);
eststo o6;
xi: heckman number_killed_oct11_bin kurd_all badawi_all kurd_badawi alawibin othermin  i.adm1_pcode, select(cncs_bin =kurd_all badawi_all kurd_badawi alawibin othermin  avgprcpchange10k avgtempchange10k temp_prcp10k ) vce(cluster adm2_en);
eststo o7;
xi: heckman number_killed_oct11_bin1k kurd_all badawi_all kurd_badawi alawibin othermin  i.adm1_pcode, select(cncs_bin =kurd_all badawi_all kurd_badawi alawibin othermin  avgprcpchange10k avgtempchange10k temp_prcp10k ) vce(cluster adm2_en);
eststo o8;
estout o1 o2 o3 o4 o5 o6 o7 o8 using basic_heckman_overlap.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons \_cons) style(tex);




